package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerDirectRelativeMapper;
import com.traffic.domain.PerDirectRelative;
import com.traffic.service.IPerDirectRelativeService;

/**
 * 直系亲属备档Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerDirectRelativeServiceImpl implements IPerDirectRelativeService 
{
    @Autowired
    private PerDirectRelativeMapper perDirectRelativeMapper;

    /**
     * 查询直系亲属备档
     * 
     * @param relativeId 直系亲属备档主键
     * @return 直系亲属备档
     */
    @Override
    public PerDirectRelative selectPerDirectRelativeByRelativeId(Long relativeId)
    {
        return perDirectRelativeMapper.selectPerDirectRelativeByRelativeId(relativeId);
    }

    /**
     * 查询直系亲属备档列表
     * 
     * @param perDirectRelative 直系亲属备档
     * @return 直系亲属备档
     */
    @Override
    public List<PerDirectRelative> selectPerDirectRelativeList(PerDirectRelative perDirectRelative)
    {
        return perDirectRelativeMapper.selectPerDirectRelativeList(perDirectRelative);
    }

    /**
     * 新增直系亲属备档
     * 
     * @param perDirectRelative 直系亲属备档
     * @return 结果
     */
    @Override
    public int insertPerDirectRelative(PerDirectRelative perDirectRelative)
    {
        return perDirectRelativeMapper.insertPerDirectRelative(perDirectRelative);
    }

    /**
     * 修改直系亲属备档
     * 
     * @param perDirectRelative 直系亲属备档
     * @return 结果
     */
    @Override
    public int updatePerDirectRelative(PerDirectRelative perDirectRelative)
    {
        perDirectRelative.setUpdateTime(DateUtils.getNowDate());
        return perDirectRelativeMapper.updatePerDirectRelative(perDirectRelative);
    }

    /**
     * 批量删除直系亲属备档
     * 
     * @param relativeIds 需要删除的直系亲属备档主键
     * @return 结果
     */
    @Override
    public int deletePerDirectRelativeByRelativeIds(Long[] relativeIds)
    {
        return perDirectRelativeMapper.deletePerDirectRelativeByRelativeIds(relativeIds);
    }

    /**
     * 删除直系亲属备档信息
     * 
     * @param relativeId 直系亲属备档主键
     * @return 结果
     */
    @Override
    public int deletePerDirectRelativeByRelativeId(Long relativeId)
    {
        return perDirectRelativeMapper.deletePerDirectRelativeByRelativeId(relativeId);
    }
}
